<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Object</title>
<!-- 
<script type="text/javascript">
	var Person = function(name, age) {
		this.name = name;
		this.age = age;
		this.introduce = function() {
			alert("My name is " + name + ". I'm " + age);
		};
	};
	var person = new Person("Somebody", 0);
	for (var p in person) {
		alert(p);
	}
	alert(person["name"]);
</script>
 -->
<script type="text/javascript">
	var Person = function(name, age) {
		var name = name;
		var age = age;
		this.getName = function() {
			return name;
		};
		this.getAge = function() {
			return age;
		};
		this.introduce = function() {
			alert("My name is " + name + ". I'm " + age);
		};
	}
	var person = new Person("Somebody", 0);
	alert(person["name"]);
	alert(person.getName());
</script>
</head>
<body>

</body>
</html>